<!doctype html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title></title> 
    <style type="text/css">

</style>
</head>
<body>
<div></div>
<div zhangrui></div>
<span></span>
<div></div>
<div class='a'></div>
<div class='a'></div>
<div></div>

<script type="text/javascript">

//var a = document.querySelectorAll('body>*:nth-child(odd)');
var a = document.querySelectorAll('.a');
/*
a[0].style.cssText='background:black;width:200px;height:200px;';
*/

	//var a = document.querySelectorAll('div');
	//a[0].style.cssText = 'background:black;width:200px;height:200px;'

	for(var i = 0;i < a.length;i++){
		a[i].style.cssText = 'background:black;width:200px;height:200px;'
	}
	
		

</script>
</body>
</html>